package com.chen.integral.module.integral.service.impl;

import com.chen.base.module.base.util.DateUtil;
import com.chen.integral.module.integral.service.RuleService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Title: manager-spring-mvc-hb
 * @Description: to do
 * @Author: chenjiwei
 * @Date: 2020-11-17 22:33
 * @Version: 1.0.0
 */
@Service
public class RuleServiceImpl implements RuleService {

    @Override
    public boolean betweenDate(Date date, String startDt, String endDt) {
        Date strToDate = DateUtil.strToDateByFormat(startDt, DateUtil.PATTERN_yyyyMMdd);
        Date endDtDate = DateUtil.strToDateByFormat(endDt, DateUtil.PATTERN_yyyyMMdd);

        return date.before(endDtDate) && date.after(strToDate);
    }

    @Override
    public Integer getTodayTotalPoint(String user) {
        return 3;
    }
}
